This notebook is a testing environment for "R"

potentially required functions can be found here: http://www.psych.mcgill.ca/misc/fda/downloads/FDAfuns/

LE:

  • March 4, 2014 MM: startet Notebook

In [1]:
%load_ext rmagic

How to run cells in R: (cell-level)

%%R -i X,Y -o XYcoef

Runs the cell in "R", passing the input variables X, Y and retrieving the output variable XYcoef from R.


In [9]:
%%R 
x1 <- rnorm(10, mean=.3, sd=3)
x2 <- x1^2
plot(x1, x2)



In [5]:
x1


Out[5]:
array([  0.,  10.,  10.])

In [22]:
%%R -o m2
x2 = seq(from=31, to=60, length=30)
m2 = matrix(data=x2, nrow=5)

In [23]:
m2


Out[23]:
array([[ 31.,  36.,  41.,  46.,  51.,  56.],
       [ 32.,  37.,  42.,  47.,  52.,  57.],
       [ 33.,  38.,  43.,  48.,  53.,  58.],
       [ 34.,  39.,  44.,  49.,  54.,  59.],
       [ 35.,  40.,  45.,  50.,  55.,  60.]])

In [ ]: